<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@include file="/commons/taglibs.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
	<title>组织管理</title>
	<script type="text/javascript">
		var applicationId = "${applicationId}";
	</script>
	<%@include file="/commons/resource.jsp"%>
	<script type="text/javascript" src="${ctx}/static/js/app/organize.js"></script>
</head>
<body class="easyui-layout">
	<!-- Search panel start -->
	<div class="ui-search-panel" region="north" style="height: 70px;"
		title="搜索框"
		data-options="striped: true,collapsible:true,iconCls:'icon-search',border:false">
		<form id="searchForm">
			<p class="ui-fields">
				<label class="ui-label">组织名:</label> <input name="organizeName"
					class="easyui-box ui-text" style="width: 100px;">
			</p>
			<input class="hidden" type="text" name="organizeId"> 
			<input name="parentId" type="hidden" /> <a href="#" id="btn-search"
				class="easyui-linkbutton" iconCls="icon-search">搜索</a>
		</form>
	</div>
	<!--  Search panel end -->
	<div region="west" border="false"
		style="border-right: 1px solid #92B7D0; width: 170px; padding: 5px;">
		<div id="menuTrees"></div>
	</div>
	<!-- DataList  -->
	<div region="center" border="false">
		<div id="toolbar">
		<perm:hasPermission url="organize/add">
			<a href="#" class="easyui-linkbutton" iconCls="icon-add" id="addBtn"
				plain="true">新增组织</a> 
		</perm:hasPermission>		
		<perm:hasPermission url="organize/edit">
			<a href="#" class="easyui-linkbutton" iconCls="icon-edit" id="editBtn" 
			 	plain="true">编辑组织</a> 
		</perm:hasPermission>	 	
		<perm:hasPermission url="organize/deleteOrganize">
			<a href="#" class="easyui-linkbutton" iconCls="icon-remove" id="deleteBtn"
				plain="true">删除组织</a>
		</perm:hasPermission>	 		
		<perm:hasPermission url="organize/distribution">
			<a href="#" class="easyui-linkbutton" iconCls="icon-add" id="distributionBtn"
				plain="true">分配角色</a>
		</perm:hasPermission>	 	
		<perm:hasPermission url="organize/addUser">		
			<a href="#" class="easyui-linkbutton" iconCls="icon-add" id="addUserBtn"
				plain="true">添加用户</a>
		</perm:hasPermission>	 	
		<perm:hasPermission url="organize/deleteUser">			
			<a href="#" class="easyui-linkbutton" iconCls="icon-remove" id="deleteUserBtn"
				plain="true">删除用户</a>
		</perm:hasPermission>		
		</div>
		<table id="data-list"></table>
	</div>

	<!-- Edit Form -->
	<div id="edit-win" class="easyui-dialog" title="组织信息编辑页面"
		data-options="closed:true,iconCls:'icon-save',modal:true"
		style="width: 420px; height: 300px;">
		<form id="editForm" class="ui-form" method="post">
				<input class="hidden" type="text" name="organizeId"> 
				<input class="hidden" type="text" name="deleted"> 
				<input class="hidden" type="text" name="menuType"> 
				<input class="hidden" type="text" name="applicationId" value="${applicationId}">
				<div class="ui-edit">
					<div class="ftitle">组织信息</div>
					<div class="fitem">
						<label>组织名称:</label> <input class="easyui-validatebox"
							type="text" name="organizeName" data-options="required:true">
					</div>
					<div class="fitem">
						<label>组织键值:</label> <input class="easyui-validatebox"
							type="text" name="organizeKey">
					</div>
					<div class="fitem">
						<label>上级组织:</label> <input id="parentId" name="parentId"
							type="text" class="easyui-combotree" style="width: 160px;"
							required="true">
					</div>
					<div class="fitem">
						<label>排序:</label> <input class="easyui-validatebox" type="text"
							name="serialNum">
					</div>
					<div class="fitem">
						<label>组织描述:</label> <input class="easyui-validatebox" type="text"
							name="organizeDesc">
					</div>
				</div>
		</form>
	</div>

 	  <!-- distribution Form -->
     <div id="distributionWin" class="easyui-dialog" title="分配角色页面" data-options="closed:true,iconCls:'icon-save',modal:true" style="width:400px;height:300px;">  
     	<form id="distributionForm" class="ui-form" method="post">  
     		 <input class="hidden" type="text" name="roleId">
     		 <input class="hidden" type="text" name="applicationId" value="${applicationId}">
     		  <input class="hidden" type="text" name="organizeId" >
     		  <div id="distributionTree" >
	          </div>
     	</form>
  	 </div>
  	 
  	  	  <!-- distribution Form -->
     <div id="edit-win-user" class="easyui-dialog" title="添加用户页面" data-options="closed:true,iconCls:'icon-save',modal:true" style="width:400px;height:300px;">  
     	<form id="editUserForm" class="ui-form" method="post">  
     		 <input class="hidden" type="text" name="organizeId">
     		 <input class="hidden" type="text" name="applicationId" value="${applicationId}">
     		 <input class="hidden" type="text" name="menuId" >
			 <table id="user-data-list"></table>
     	</form>
  	 </div>
	
</body>
</html>
